package org.example.feign;

//TODO 订单业务模块调用商品业务模块：feign接口

import org.example.domain.Prod;
import org.example.domain.Sku;
import org.example.feign.sentinel.OrderProdFeignSentinel;
import org.example.model.ChangeStock;
import org.example.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


@FeignClient(value = "product-service",contextId = "OrderProdClient" , fallback = OrderProdFeignSentinel.class)
public interface OrderProdFeign {

    @GetMapping("/prod/prod/getSkuListBySkuIds")
    public Result<List<Sku>> getSkuListBySkuIds(@RequestParam List<Long> skuIds);

    @GetMapping("/prod/prod/getProdListByShopIds")
    public Result<List<Prod>> getProdListByProIds(@RequestParam List<Long> shopIds);

    @PostMapping("/prod/prod/changeProdAndSkuStock")
    public Result<Boolean> changeProdAndSkuStock(@RequestBody ChangeStock changeStock);

}
